<?php

define('IN_API', true);
require_once '../../framework/bootstrap.inc.php';
require_once 'defines.php';
$time = intval($_GPC['time']);
$id = intval($_GPC['id']);
$pwd = $_GPC['pwd'];
$settings = pdo_get("uni_account_modules", array("module" => MODULE_NAME , "uniacid" => $id));
$settings = unserialize($settings['settings']);
if($pwd != $settings['pid_pwd'] || !$settings['pid_pwd'] || $settings['pid_pwd'] === NULL){
    echo '密码不正确</br>';
	exit();
}
if($time<72){$time=72;}
$retime = time() - $time *3600;
echo $retime;
if($settings['system_type'] == 1){
	pdo_update(MODULE_NAME."_pid_u", array("uid" => 0 , "nickname" => '' , "openid" => '' , "unionid" => '' , "is_use" => 0 , "use_time" => 0,"update_time" => 0),array("system_id" => $settings['system_id'], "update_time <" => $retime));
	echo '联营PID释放完毕';
}else{
	pdo_update(MODULE_NAME."_pid", array("uid" => 0 , "nickname" => '' , "openid" => '' , "unionid" => '' , "is_use" => 0 , "use_time" => 0,"update_time" => 0),array("uniacid" => $id, "update_time <" => $retime));
	echo 'PID释放完毕';
}